Remove & Change Background
We currently support background removal, background masking, and face masking.
API Endpoints
- Run
- Status
https://api.imagepipeline.io/bgremover/v1
API-Key
{
"init_image": "https://f005.backblazeb2.com/b2api/v2/b2_download_file_by_id?fileId=4_zfdf0a8ed59e8666b89b10713_f102b7f8df9a9feb7_d20240131_m105912_c005_v0501014_t0017_u01706698752119",
"post_process_mask": false,
"alpha_matting": false,
"mask_background": false,
"face_mask":false
}
https://api.imagepipeline.io/bgremover/v1/status/{{task_id}}
API-Key
- Remove Background
- Mask Background
- Mask Face
- Change Background
- Change Face
{
"init_image": "https://f005.backblazeb2.co.....",
"post_process_mask": false,
"alpha_matting": false,
"mask_background": false,
"face_mask":false
}
{
"init_image": "https://f005.backblazeb2.co.....",
"post_process_mask": true,
"alpha_matting": true,
"mask_background": true,
"face_mask":false
}
{
"init_image": "https://f005.backblazeb2.co.....",
"post_process_mask": false,
"alpha_matting": false,
"mask_background": false,
"face_mask":true
}
https://api.imagepipeline.io/[sd or sdxl]/inpainting/v1/
{
"mask_image": "https://f005.backblazeb2.com/b2api/v2/b2_download_file_by_id?fileId=4_zfdf0a8ed59e8666b89b10713_f119fa5b6b7cffe16_d20240202_m135221_c005_v0501011_t0008_u01706881941925", // you have to take the mask background image from the previous API call response and pass it as "mask_image" for inpainting task
"init_image": "https://docs.imagepipeline.io/img/imagepipeline-cartoon-ai.png", //Init img needs to be a publicly available link
"prompt": "snow in city, roads, traffic lights in the background,",
"negative_prompt": "error, cropped, worst quality, low quality, duplicate, blurry, (unfinished objects), stock image, artifacts, ((fused fingers)), bad hands, (((too many fingers))), (((deformed hands))), disproportional hands",
"model_id": "sdxl", //Add any sdxl checkpoint model_id from Models page
"num_inference_steps": 20,
"refiner": false, //Setting it to true will pass generated images through refiner
"samples": 4, //Upto 4 samples supported
"guidance_scale": 7.5,
"width": 1024,
"height": 1024,
"seed": -1,
"scheduler": "UniPCMultistepScheduler"
//"server_id": "" //For enterprise users only
}
https://api.imagepipeline.io/[sd or sdxl]/inpainting/v1/
{
"mask_image": "https://f005.backblazeb2.com/b2api/v2/b2_download_file_by_id?fileId=4_zfdf0a8ed59e8666b89b10713_f1085d87db04ae35f_d20240202_m154058_c005_v0501008_t0053_u01706888458357", // you have to take the mask face image from the previous API call response and pass it as input for inpainting task
"init_image": "https://docs.imagepipeline.io/img/imagepipeline-cartoon-ai.png", //Init img needs to be a publicly available link
"prompt": "warrior chinese hero, furius, realistic, high detail",
"negative_prompt": "error, cropped, worst quality, low quality, duplicate, blurry, (unfinished objects), stock image, artifacts, ((fused fingers)), bad hands, (((too many fingers))), (((deformed hands))), disproportional hands",
"model_id": "sdxl", //Add any sdxl checkpoint model_id from Models page
"num_inference_steps": 20,
"refiner": false, //Setting it to true will pass generated images through refiner
"samples": 4, //Upto 4 samples supported
"guidance_scale": 7.5,
"width": 1024,
"height": 1024,
"seed": -1,
"scheduler": "UniPCMultistepScheduler"
//"server_id": "" //For enterprise users only
}
JSON Parameters
Parameter | Description | Type | Default Value |
---|---|---|---|
init_image | Public URL for the initial image to be worked upon | string | Required |
face_mask | Whether you need to mask the face to change it later | boolean | false |
alpha_mating | Create a soft boundary around the object in the foreground | boolean | true |
mask_background | Whether if you want to create mask background to change the background later or just remove background | boolean | false |